package com.ctg.payroll2.service.workflow;

import java.sql.SQLException;

import com.ctg.payroll2.bean.filter.workflow.FlowRoleFilter;
import com.ctg.payroll2.bean.po.SysUser;
import com.ctg.payroll2.bean.po.workflow.FlowRole;
import com.ctg.platform.core.security.Exception.RoleNameException;
import com.ctg.platform.core.security.Exception.SecurityException;
import com.ctg.platform.util.Page;

public interface WorkflowRoleService {
	/**
	 * 新增流程角色
	 * 
	 * @param user
	 *            流程角色
	 * @return 主键
	 */
	Long insertFlowRole(FlowRole role, SysUser currentUser)
			throws SecurityException, SQLException, RoleNameException;

	/**
	 * 根据以逗号分隔的id删除流程角色
	 * 
	 * @param ids
	 *            逗号分隔的id
	 * @return 影响的数量
	 */
	int deleteFlowRoleByIds(String ids, SysUser currentUser)
			throws SQLException;

	/**
	 * 翻页查询
	 * 
	 * @param filter
	 * @return
	 */
	Page queryFlowRoleByFilter(FlowRoleFilter filter);

	/**
	 * sami,根据roleId查询RoleUser
	 * 
	 * @param paraMap
	 * @param statr
	 * @param limit
	 * @return
	 */
	Page queryFlowUserByRole(Object paraMap, Integer start, Integer limit);

	/**
	 * sami,根据flow_orgid查询未被注册过的RoelUser
	 * 
	 * @param paraMap
	 * @param statr
	 * @param limit
	 * @return
	 */
	Page queryRoleUserNotInRoleUser(Object paraMap, Integer start, Integer limit);

	/**
	 * 删除RoleUser
	 * 
	 * @param paraMap
	 * @return
	 */
	Integer deleteRoleUser(Object paraMap);
	
	/**新增角色对应账户
	 * @param paraMap
	 */
	void insertUserByRole(Object paraMap);
}
